package com.yl.chainStore.entity.system

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.yl.chainStore.common.Constants
import com.yl.common.annotation.NoArg
import com.yl.common.getContext

/**
 * <p>
 *
 * </p>
 *
 * @author cxw
 * @since 2021-06-17
 */
@NoArg
@TableName("table_other_column")
data class TableOtherColumn(

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    var id: Long,

    /**
     * 存储字段
     */
    @TableField("name")
    var name: String,

    /**
     * 显示字段
     */
    @TableField("view_name")
    var viewName: String,

    /**
     * 类型 TABLE_COLUMN_INPUT开头
     */
    @TableField("type")
    var type: Int = Constants.TableColumn.TABLE_COLUMN_INPUT_LONGITUDINAL,

    /**
     * 组id
     */
    @TableField("group_id")
    var groupId: Long,

    /**
     * 源数据
     */
    @TableField("data_source")
    var dataSource: String? = null,

    /**
     * 默认提示
     */
    @TableField("hint")
    var hint: String? = null,

    /**
     * 默认值
     */
    @TableField("default_value")
    var defaultValue: String? = null,

    /**
     * 长度（字符用）
     */
    @TableField("length")
    var length: Int? = null,

    /**
     * 最小值
     */
    @TableField("min_value")
    var minValue: Long? = null,

    /**
     * 最大值
     */
    @TableField("max_value")
    var maxValue: Long? = null,

    /**
     * 正则表达式
     */
    @TableField("rangx")
    var rangx: String? = null,

    /**
     * 是否必填
     */
    @TableField("must")
    var must: Int = 0,

    /**
     * 错误提示
     */
    @TableField("error_hit")
    var errorHit: String? = null,

    /**
     * 备用
     */
    @TableField("value")
    var value: String? = null,

    /**
     * 排序
     */
    @TableField("order_num")
    var orderNum: Int? = 99,

    /**
     * 是否显示
     */
    @TableField("show")
    var show: Int = 1,

    /**
     * 能否操作
     */
    @TableField("can_update")
    var canUpdate: Int = 1,

    @TableField("company_id")
    var companyId:Long = getContext().companyId,

    /**
     * 列表显示
     */
    @TableField("list_view")
    var listView:Int = 1,

    @TableField("insert_show")
    var insertShow:Int = 1,

    @TableField("can_show")
    var canShow:Int = 1,

    @TableField("fixed")
    var fixed:String ?= null,

    @TableField("show_name")
    var showName:String ?= null,

    @TableField("column_width")
    var columnWidth:String = "",

    @TableField("call_back_name")
    var callBackName:String = name
)
